<?php

namespace App\Console;

use Carbon\Carbon;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;

class Kernel extends ConsoleKernel
{
    /**
     * The Artisan commands provided by your application.
     *
     * @var array
     */
    protected $commands = [
        //
    ];

    /**
     * Define the application's command schedule.
     *
     * @param  \Illuminate\Console\Scheduling\Schedule $schedule
     * @return void
     */
    protected function schedule(Schedule $schedule)
    {
        // $schedule->command('inspire')
        //          ->hourly();
        $schedule->command('command:ybsarticle')->description(Carbon::now()->toDateTimeString() . '定时存储研报社数据!')->everyFiveMinutes()->withoutOverlapping();

        $schedule->command('command:capstock')->description(Carbon::now()->toDateTimeString() . '股票资金数据监听!')->everyMinute()->withoutOverlapping();

        $schedule->command('command:stock_data_clean')->description(Carbon::now()->toDateTimeString() . '数据清洗')->dailyAt('15:20')->withoutOverlapping();

        $schedule->command('command:collect_web_article')->description(Carbon::now()->toDateTimeString() . '获取文章数据')->everyTenMinutes()->withoutOverlapping();

        $schedule->command('command:log_admin_operation')->description(Carbon::now()->toDateTimeString() . '定时保存后台操作数据!')->everyMinute()->withoutOverlapping();

        $schedule->command('command:stockpea')->description(Carbon::now()->toDateTimeString() . 'pe/pb/dv数据采集')->dailyAt('20:20')->withoutOverlapping();
    }

    /**
     * Register the commands for the application.
     *
     * @return void
     */
    protected function commands()
    {
        $this->load(__DIR__ . '/Commands');

        require base_path('routes/console.php');
    }
}
